<?php
require_once("./libs/Smarty.class.php");
$sm = new Smarty;
$hei_cnt = 10;
$wid_cnt = 10;

for($i=0; $i<$hei_cnt; $i++){
    echo "<tr>";
    for($c=0; $c<$wid_cnt; $c++){
        echo "<td>";
        if($i==0){
            echo $c;
        }else{
            echo($c==0)?$c+$i:$c*$i;
        }
        echo"</td>";
    }
    echo"</tr>";
}

$sm->assign("hei_cnt",$hei_cnt);
$sm->assign("wid_cnt",$wid_cnt);
$sm->display("test.tpl");
?>